<!DOCTYPE HTML>
<html>
    <head>
        <meta charset="utf-8">
        <link rel="icon" href="https://static.jianshukeji.com/highcharts/images/favicon.ico">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <style>
            /* css 代码  */
        </style>
        <script src="https://img.hcharts.cn/highcharts/highcharts.js"></script>
        <script src="https://img.hcharts.cn/highcharts/modules/exporting.js"></script>
        <script src="https://img.hcharts.cn/highcharts-plugins/highcharts-zh_CN.js"></script>
        <script src="../plugins/bower_components/jquery/dist/jquery.min.js"></script>
        
        <script>
        $(function () {
        	
        	$.post('../summary/countGender.action',function(data){
        		
        		// 创建渐变色
                Highcharts.getOptions().colors = Highcharts.map(Highcharts.getOptions().colors, function (color) {
                    return {
                        radialGradient: { cx: 0.5, cy: 0.3, r: 0.7 },
                        stops: [
                            [0, color],
                            [1, Highcharts.Color(color).brighten(-0.3).get('rgb')] // darken
                        ]
                    };
                });
             	
                // 构建图表
                var chart = Highcharts.chart('container',{
                    title: {
                        text: '评估结果 - 性别比重',
                        style: { "color": "green", "font-family":"隶书", "fontSize":"40px"}
                    },
                    tooltip: {
                        pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
                    },
                    plotOptions: {
                        pie: {
                            allowPointSelect: true,
                            cursor: 'pointer',
                            dataLabels: {
                                enabled: true,
                                format: '<b>{point.name}</b>: {point.percentage:.1f}%',
                                style: {
                                    color: (Highcharts.theme && Highcharts.theme.contrastTextColor) || 'red',
                                    fontSize: "16px",
                                    fontFamily:"宋书"
                                },
                                connectorColor: 'silver'
                            },
                            colors:['yellow','green']
                        }
                    },
                    series: [{
                        type: 'pie',
                        name: '性别占比',
                        data: [
                            ['男' , data.gender_1?data.gender_1:0],
                            ['女' , data.gender_2?data.gender_2:0],
                        ]
                    }],
                    credits:{
                    	enabled:false
                    }
                });
        	})
        	
        });
        </script>
    </head>
    
    
    <body style="background-color: white;">
        <div id="container" style="height:650px;"></div>
    </body>
</html>